<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center submitRecord_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub submitRecord_fd0_0'>
					<view class='flex flex-wrap align-center submitRecord_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  submitRecord_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='submitRecord_fd0_0_c1_c0'>租房登记</text>
					</view>
					<view class='flex flex-wrap align-center justify-end submitRecord_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout submitRecord_flex_1">
				<view class='flex flex-direction flex-wrap align-stretch submitRecord_fd1_0'
					v-for="(item,index) in listData" :key="index">
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'>
						<text class='submitRecord_fd1_0_c0_c0'>城市：</text>
						<text class='submitRecord_fd1_0_c0_c1'>{{item.city}}</text>
					</view>
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'>
						<text class='submitRecord_fd1_0_c0_c0'>小区地址：</text>
						<text class='submitRecord_fd1_0_c0_c1'>{{item.address}}</text>
					</view>
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'>
						<text class='submitRecord_fd1_0_c0_c0'>楼栋门牌：</text>
						<text class='submitRecord_fd1_0_c0_c1'>{{item.building_number}}</text>
					</view>
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'>
						<text class='submitRecord_fd1_0_c0_c0'>房屋类型：</text>
						<text class='submitRecord_fd1_0_c0_c1'>{{item.housecate_name}}</text>
					</view>
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'>
						<text class='submitRecord_fd1_0_c0_c0'>姓名：</text>
						<text class='submitRecord_fd1_0_c0_c1'>{{item.full_name}}</text>
					</view>
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'>
						<text class='submitRecord_fd1_0_c0_c0'>联系方式：</text>
						<text class='submitRecord_fd1_0_c0_c1'>{{item.telephone}}</text>
					</view>
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'>
						<text class='submitRecord_fd1_0_c0_c0'>提交时间：</text>
						<text class='submitRecord_fd1_0_c0_c1'>{{item.create_time}}</text>
					</view>
					<view class='flex flex-wrap align-center submitRecord_fd1_0_c0'
						v-if="item.state == 2?false:true">
						<text class='submitRecord_fd1_0_c0_c0'>驳回原因：</text>
						<text class='submitRecord_fd1_0_c7_c1'>{{item.hidden_text}}</text>
					</view>
					<button class='submitRecord_fd1_0_c8' v-if="item.state == 1"
						@click="toLuruF(item)">完善信息</button>
					<button class='submitRecord_fd1_0_c8' @tap.stop="handlechongxingbianjiJumpDiy(item)" v-if="item.state == 2">重新编辑</button>
					<button class='submitRecord_fd1_0_c8' v-if="item.state == 0">撤回申请</button>
					<image class='submitRecord_fd1_0_c9' mode="aspectFit" :src='STATIC_URL+"129.png"'
						v-if="item.state == 1"></image>
					<image class='submitRecord_fd1_0_c9' mode="aspectFit" :src='STATIC_URL+"130.png"'
						v-if="item.state == 2"></image>
					<image class='submitRecord_fd1_0_c9' mode="aspectFit" :src='STATIC_URL+"132.png"'
						v-if="item.state == 0"></image>
				</view>
				<view v-if="listData.length == '0'" class="flex justify-center" style="width: 100%;">
					<fu-empty-ui></fu-empty-ui>
				</view>
			</view>
			<!---flex布局flex布局结束-->
		</view>
	</view>
</template>
<script>
	export default {
		components: {},
		data() {
			return {
				listData: [],
			};
		},
		filters: {
			timeFormat(timestamp) {
				var time = new Date(timestamp * 1000);
				var y = time.getFullYear(); //getFullYear方法以四位数字返回年份
				var m = time.getMonth() + 1; // getMonth方法从 Date 对象返回月份 (0 ~ 11)，返回结果需要手动加一
				var d = time.getDate(); // getDate方法从 Date 对象返回一个月中的某一天 (1 ~ 31)
				var h = time.getHours();
				var f = time.getMinutes()

				function timeAdd(m) {
					return m < 10 ? '0' + m : m;
				};
				var timeStr = y + "-" + timeAdd(m) + "-" + timeAdd(d) + '  ' + timeAdd(h) + ':' + timeAdd(f);
				return timeStr;
			}
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
		},
		watch: {},
		onLoad(options) {
			this.getListVal()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			handlechongxingbianjiJumpDiy(item){
				uni.navigateTo({
					url:`/pages/grzx/myRent/myRent?item=${JSON.stringify(item)}`
				})
			},
			getListVal() {
				uni.showLoading({
					title: '加载中'
				});
				this.$api.post('/m6752/677e40d4c842a', {}).then(res => {
					uni.hideLoading()
					if (res.data.code == 1) {
						this.listData = res.data.data.data
					}
				})
			},
			toLuruF(item) {
				// if (id == 1) {
				// 	// id为1跳转录入住宅
				// 	let zhuzhailr = {
				// 		id: id,
				// 		city: city
				// 	}
				// 	uni.setStorageSync('zhuzhailr', zhuzhailr)
					uni.navigateTo({
						url: `/pages/grzx/enterResidence/enterResidence?housecate_name=${item.housecate_name}&aid=${item.aid}`
					})
				// } else {
				// 	let qitalr = {
				// 		id: id,
				// 		city: city
				// 	}
				// 	uni.setStorageSync('qitalr', qitalr)
				// 	uni.navigateTo({
				// 		url: `/pages/grzx/inputOfficeBuilding/inputOfficeBuilding`
				// 	})
				// }
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.submitRecord_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.submitRecord_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 40rpx;
	}

	.submitRecord_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.submitRecord_fd0_0_c0 {
		width: 120rpx;
	}

	.submitRecord_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.submitRecord_flex_1 {
		padding: 24rpx 24rpx 0rpx 24rpx;
	}

	.submitRecord_fd1_0_c9 {
		width: 88rpx;
		height: 88rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		position: absolute;
		top: 24rpx;
		right: 24rpx;
	}

	.submitRecord_fd1_0_c8 {
		background: #FC5F80;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		width: 480rpx;
		line-height: 88rpx;
		font-size: 32rpx;
		color: #fff;
		height: 88rpx;
		font-weight: 500;
		margin: 16rpx 0rpx 0rpx 87rpx;
	}

	.submitRecord_fd1_0_c7_c1 {
		color: rgba(234, 64, 64, 1);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 32rpx;
	}

	.submitRecord_fd1_0_c0_c1 {
		color: var(--benbenFontColor0);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 32rpx;
	}

	.submitRecord_fd1_0_c0_c0 {
		color: var(--benbenFontColor2);
		font-size: 28rpx;
		font-weight: 400;
		line-height: 32rpx;
	}

	.submitRecord_fd1_0_c0 {
		padding: 16rpx 0rpx 16rpx 0rpx;
	}

	.submitRecord_fd1_0 {
		background: var(--benbenbgColor1);
		margin: 0rpx 0rpx 24rpx 0rpx;
		padding: 16rpx 24rpx 32rpx 24rpx;
		border-radius: 16rpx;
		background-size: 100% auto;
		position: relative;
	}
</style>